package radubrehar;

public class Link {

	private String URL = new String();

	private int hits = 0;

	private int id;

	public Link() {

	}
	
	public Link(String URL){
		this.URL = URL;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getHits() {
		return hits;
	}

	public void setHits(int hits) {
		this.hits = hits;
	}
	
	public void incrementHits(){
		this.hits++;
	}

	public String getURL() {
		return URL;
	}

	public void setURL(String url) {
		URL = url;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Link) {
			Link l = (Link) obj;
			if (this.URL.equals(l.getURL())) {
				return true;
			}
			return false;
		}

		return false;
	}
}
